package com.sskj.finance.presenter;

import com.lzy.okgo.model.Response;
import com.lzy.okrx2.adapter.FlowableBody;
import com.sskj.common.base.HttpData;
import com.sskj.finance.bean.HomeBorrowBorrowInfoBean;
import com.sskj.finance.bean.HomeBorrowGetTransrecordBean;
import com.sskj.finance.bean.HomeBorrowMortgageInfoBean;
import com.sskj.finance.bean.HomeLendBlend;
import com.sskj.finance.bean.HomeLendLendCoinListBean;
import com.sskj.finance.bean.TransferRecordBean;
import com.sskj.finance.http.HttpConfig;
import com.sskj.finance.ui.activity.TransferRecordActivity;
import com.sskj.lib.bean.PageBean;
import com.sskj.lib.http.JsonCallBack;
import com.sskj.lib.http.JsonConverter;

import java.util.ArrayList;
import java.util.List;

import io.reactivex.Flowable;


public class TransferRecordActivityPresenter extends BasePresenter<TransferRecordActivity> {


    /**
     * 划转记录
     *
     * @param page 页码，默认1
     * @param size 页条数，默认10
     * @return
     */
    public Flowable<List<TransferRecordBean>> transfer_record(String page, String size) {
        return httpService.transfer_record(page, size)
                .converter(new JsonConverter<HttpData<PageBean<TransferRecordBean>>>() {
                })
                .adapt(new FlowableBody<>())
                .map(pageBeanHttpData -> pageBeanHttpData.getData().getList())
                .onErrorReturnItem(new ArrayList<>());
    }











}
